import Vue from 'vue'
import VueRouter from 'vue-router'

// 引入用户相关组件
import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
import Verification from '../components/Verification.vue'
import Home from '../components/Home.vue'
import Shop from '../components/Shop.vue'
import Order from '../components/Order.vue'
import Mine from '../components/Mine.vue'
import Goods from '../components/Goods.vue'
import AddressList from '../components/Address/List.vue'
import AddressEdit from '../components/Address/Edit.vue'
import Comment from '../components/Comment.vue'
import CommentList from '../components/CommentList.vue'


//引入骑手配送组件
import FoodDelivery from '../components/FoodDelivery.vue'

//测试组件
import test from '../components/test.vue'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  }, {
    path: '/login',
    component: Login
  }, {
    path: '/register',
    component: Register
  }, {
    path: '/verification',
    component: Verification
  }, {
    path: '/home',
    component: Home,
    redirect: '/shop',
    children: [
      {
        path: '/shop',
        component: Shop
      }, {
        path: '/order',
        component: Order
      }, {
        path: '/mine',
        component: Mine
      }, {
        path: '/commentlist',
        component: CommentList
      }
    ]
  }, {
    path: '/goods',
    component: Goods
  }, {
    path: '/address/list',
    component: AddressList
  }, {
    path: '/address/edit',
    component: AddressEdit
  }, {
    path: '/comment',
    component: Comment
  }, {
    path: '/fooddelivery',
    component: FoodDelivery
  }, {
    path: '/test',
    component: test
  }
]

const router = new VueRouter({
  routes
})

export default router
